$state = `getAttr ($char + ":ac_rt_leg_settings_ctrl.ik_leg")`;

if ($state == 1)
{



float $auto_stretch_up = `getAttr ($char + ":ikfk_switch_bridge.rt_up")`;
float $auto_stretch_mid = `getAttr ($char + ":ikfk_switch_bridge.rt_mid")`;
float $auto_stretch_low = `getAttr ($char + ":ikfk_switch_bridge.rt_dn")`;

float $rotation[] = `xform -q -ws -ro ($char + ":ac_rt_hipFK_dup")`; 
xform -ws -ro $rotation[0] $rotation[1] $rotation[2] ($char + ":ac_rt_hipFK_ctrl");

float $kenn_rotation[] = `xform -q -ws -ro ($char + ":ac_rt_kneeFK_dup")`; 


float $lowleg_rotation[] = `xform -q -ws -ro ($char + ":ac_rt_lowleg_fk_dup")`; 


float $foot_rotation[] = `xform -q -ws -ro ($char + ":ac_rt_footFK_dup")`; 


float $toe_rotation[] = `xform -q -ws -ro ($char + ":sk_rt_ballC")`; 



setAttr ($char + ":ac_rt_leg_settings_ctrl.ik_leg") 0;

xform -ws -ro $kenn_rotation[0] $kenn_rotation[1] $kenn_rotation[2] ($char + ":ac_rt_kneeFK_ctrl");
xform -ws -ro $lowleg_rotation[0] $lowleg_rotation[1] $lowleg_rotation[2] ($char + ":ac_rt_lowleg_fk_ctrl");
xform -ws -ro $foot_rotation[0] $foot_rotation[1] $foot_rotation[2] ($char + ":ac_rt_footFK_ctrl");
xform -ws -ro $toe_rotation[0] $toe_rotation[1] $toe_rotation[2] ($char + ":ac_rt_toe_ctrl");

setAttr ($char + ":ac_rt_hipFK_ctrl.stretch") ($auto_stretch_up  );
setAttr ($char + ":ac_rt_kneeFK_ctrl.stretch") ($auto_stretch_mid  );
setAttr ($char + ":ac_rt_lowleg_fk_ctrl.stretch") ($auto_stretch_low );


setAttr ($char + ":ac_rt_kneeIK_ctrl.tx") 0;
setAttr ($char + ":ac_rt_kneeIK_ctrl.ty") 0;
setAttr ($char + ":ac_rt_kneeIK_ctrl.tz") 0;


setAttr ($char + ":ac_rt_dnkneeIK_ctrl.tx") 0;
setAttr ($char + ":ac_rt_dnkneeIK_ctrl.ty") 0;
setAttr ($char + ":ac_rt_dnkneeIK_ctrl.tz") 0;





}

else

{

float $dupmid_position[] = `xform -q -ws -t ($char + ":ac_rt_kneeIK_ctrl")`;
float $duplow_position[] = `xform -q -ws -t ($char + ":ac_rt_dnkneeIK_ctrl")`; 



float $position[] = `xform -q -ws -t ($char + ":ac_rt_footIK_dup")`;
float $rotation[] = `xform -q -ws -ro ($char + ":ac_rt_footIK_dup")`; 
xform -ws -t $position[0] $position[1] $position[2] ($char + ":ac_rt_footIK_ctrl");
xform -ws -ro $rotation[0] $rotation[1] $rotation[2] ($char + ":ac_rt_footIK_ctrl");



float $position[] = `xform -q -ws -t ($char + ":ac_rt_legPole_dup")`;
float $rotation[] = `xform -q -ws -ro ($char + ":ac_rt_legPole_dup")`; 
xform -ws -t $position[0] $position[1] $position[2] ($char + ":ac_rt_legPole_ctrl");
xform -ws -ro $rotation[0] $rotation[1] $rotation[2] ($char + ":ac_rt_legPole_ctrl");




float $toe_rotation[] = `xform -q -ws -ro ($char + ":sk_rt_ballC")`; 



setAttr ($char + ":ac_rt_footIK_ctrl.footLift") 30;
setAttr ($char + ":ac_rt_footIK_ctrl.footStraight") 60;
setAttr ($char + ":ac_rt_footIK_ctrl.footRoll") 0;


setAttr ($char + ":ac_rt_footIK_ctrl.Side") 0;
setAttr ($char + ":ac_rt_footIK_ctrl.liftHeel") 0;
setAttr ($char + ":ac_rt_footIK_ctrl.pinToe") 0;
setAttr ($char + ":ac_rt_footIK_ctrl.liftFoot") 0;
setAttr ($char + ":ac_rt_footIK_ctrl.raiseToe") 0;
setAttr ($char + ":ac_rt_footIK_ctrl.shakeToe") 0;



//setAttr ($char + ":ac_rt_footIK_ctrl.lowKneeMove") 0;
setAttr ($char + ":ac_rt_footIK_ctrl.straighten") 0;
setAttr ($char + ":ac_rt_footIK_ctrl.offSet") 0;

setAttr ($char + ":ac_rt_footIK_ctrl.togetherStretch") 0;
//setAttr ($char + ":ac_rt_footIK_ctrl.upKneeMove") 0;



setAttr ($char + ":ac_rt_leg_settings_ctrl.ik_leg") 1;

xform -ws -ro $toe_rotation[0] $toe_rotation[1] $toe_rotation[2] ($char + ":ac_rt_toe_ctrl");



xform -ws -t $dupmid_position[0] $dupmid_position[1] $dupmid_position[2] ($char + ":ac_rt_kneeIK_ctrl");
xform -ws -t $duplow_position[0] $duplow_position[1] $duplow_position[2] ($char + ":ac_rt_dnkneeIK_ctrl");


}


